Remote Debugging with Visual Studio

A remote debugging session consists of a Host-Target connection, where the Visual Studio IDE resides on the host system and the process to be debugged resides on a target system on the local network. This section describes the steps necessary for setting up a target PC and a host PC for debugging RTSS applications remotely with Visual Studio.

Sections in this Topic:

For a more comprehensive example of debugging an RTSS application, see MiniTutorial: Debugging Applications in Visual Studio.

Target Setup

Setup of the Target system requires the following steps:

Install the Remote Debugger Tools:

  • Install the Visual Studio remote debugger tools onto the Target system. Follow the instructions available from Microsoft to determine which install you will need:

https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging

Install the RTX64 Runtime:

For remote debugging with Visual Studio to work, the RTX64 Remote Debugger tools must be installed on the target system, no matter what version of the Visual Studio remote debugger tools is installed. If this is not already present on your system, the Runtime installer will install it for you.

Configure Remote Debugging:

For launch:

  • Configure the Visual Studio remote tools

For attach: 

  • Configure the Visual Studio remote tools
  • Configure remote debugging through the Control Panel:
  • Select Allow new remote debugging attach connections to this computer
  • Set the IP address and Port number.

Start the Subsystem:

Copy/Paste Remote Debugging Files:

  1. Navigate to C:\Program Files\IntervalZero\Common\RemoteTools.
  1. Copy these files:
  1. Navigate to C:\Program Files\Microsoft Visual Studio (2015/2017/2019)\Common7\IDE\Remote Debugger\x64, and then paste the two files into that folder.

Host Setup

Create or open the project in Visual Studio:

Select the IntervalZero Remote Real-Time Debugger:

  1. With the project open in Visual Studio, select the IntervalZero Remote Real-Time Debugger from the Debugger drop-down.
  2. In the Property Pages dialog, click Configuration Properties > Debugging. Do the following:
  3. Make sure IntervalZero Remote Real-Time Debugger is selected.
  4. Set the Command line to the full local path to the binary you want to launch on the Target system. For example: C:\Debug\RtssRemoteApp.rtss.
  5. Specify any Command Arguments.
  6. Set the Remote Server Name to the name of the Target system.

NOTE: If the Remote Server Name you provide is invalid, the following error is encountered: The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. More appropriately, the Visual Studio Remote Debugger service on the target computer cannot connect back to this computer. The debugger is unable to resolve the specified computer name.

Debug the Target Application

IMPORTANT! The version of the Visual Studio Remote Tools installed on the Target system must exactly match the Visual Studio version on the Local system (the system running the debugger).

Start MSVSMON:

  1. On the Target system, launch the Visual Studio Remote Debugger from Start > All Programs > Visual Studio 2022/2019/2017/2015.
  2. On the Host system, build the RtssDebug configuration of the binary you want to debug, and then copy that binary to the Command line path on the Target system that you specified in Step 2b under Host Setup.
  3. On the Host system, in Visual Studio, press F5 or Debug > Start Debugging to debug the binary on the Target system. You should see the Host/Target connection in the Visual Studio Remote Debugging Monitor dialog.

Troubleshooting

If there are any problems connecting the host and target systems:

NOTE: Visual Studio may close and restart if the connection is lost during remote debugging.

For a more comprehensive example of debugging a RTSS application, see MiniTutorial: Debugging Applications in Visual Studio.

Related Topics:

MiniTutorials: